<template>
  <div class="right-onlineSupply">
    <div class="tab-title">
      <span class="dec">线上供需情况</span>
    </div>
    <div class="supply-content">
      <template v-for="(item,index) in supplyList">
        <div class="single" :key="index">
            <img :src="item.img" alt="">
            <div class="name">{{item.name}}</div>
            <div>{{item.num}}</div>
        </div>
      </template>
    </div>
  </div>
</template>
<script>
import {querySupplyDemandDetaildp} from '@/api/dashboards'
export default {
  data(){
    return{
      supplyList:[
            {
              img:require('../../assets/xsjjr.png'),
              name:'线上经纪人 (个)',
              num:0
            },
            {
              img:require('../../assets/ljxqxx.png'),
              name:'累计需求信息 (单)',
              num:0
            },
            {
              img:require('../../assets/ljgyxx.png'),
              name:'累计供应信息 (单)',
              num:0
            },
        ],
    }
  },
  created(){
  },
  mounted() {
    this.querySupplyDemandDetaildp()
  },
  methods: {
    async querySupplyDemandDetaildp() {
      let res = await querySupplyDemandDetaildp()
      if(res.result){
        this.supplyList[0].num = res.result.brokerNum&&res.result.brokerNum
        this.supplyList[1].num = res.result.demandNum&&res.result.demandNum
        this.supplyList[2].num = res.result.supplyNum&&res.result.supplyNum
      }
     
    },
  },
}
</script>
<style lang="less" scoped>
.right-onlineSupply {
  width: 360px;
  height: 189px;
  color: #fff;
  .tab-title {
      padding: 24px 10px 0 24px;
    .dec {
        width: 196px;
        height: 14px;
        font-size: 14px;
        font-weight: 600;
        color: #FFFFFF;
        line-height: 14px;
    }
  }
   .supply-content{
     width: 360px;
     padding: 0 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    justify-content: space-between;
    position: absolute;
    top: 53px;
    left: 50%;
    transform: translate(-50%);
    z-index: 99;
    border-radius: 6px;
    .single{
      padding-top: 18px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      img{
        width: 60px;
        height: 60px;
      }
      .name{
        max-width: 100px;
        color: rgba(255, 255, 255, 0.4);
        font-size: 12px;
        font-weight: 400;
        padding-bottom: 5px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }
    }
    .line{
      width: 1px;
      height: 118px;
    }
  }
}
</style>